<?php

namespace System\Lib\Twitter\Auth;

/**
 * Description of SmPlainText
 *
 * @author Elton Schivei Costa
 */
class SmPlainText extends ASignatureMethod
{

    public function BuildSignature(Request &$request, Customer &$consumer, Token &$token)
    {
        $key_parts = array(
            $consumer->Secret->ToString(),
            ($token) ? $token->Secret->ToString() : ""
        );

        $key_parts = Util::urlencode_rfc3986($key_parts);
        $key = \implode('&', $key_parts);
        $request->baseString = $key;

        return $key;
    }

    public function GetName()
    {
        return "PLAINTEXT";
    }

}
